#include <Arduino.h>
#include <U8g2lib.h>
#include "image.cpp"
#include "screen.h"
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>屏幕
U8G2_SSD1306_128X64_NONAME_1_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE, 5, 4); //rst sck sda
void ScreenInit() {
  u8g2.begin();
  u8g2.setDisplayRotation(U8G2_R2);
  u8g2.firstPage();
  u8g2.setFont(u8g2_font_ncenB08_tr);
  DrawEmoji(pig);
}
void DrawEmoji(const uint8_t *bitmap) {
  do{
    u8g2.drawXBMP(0,0,128,64,bitmap);
  }while(u8g2.nextPage());
}
void ScreenClear() {
  u8g2.clearDisplay();
}
void ShowWiFi(String apIP,String localIP) {
  do{
    u8g2.drawStr(32,10,"Super Puppy");
    u8g2.drawStr(0,27,apIP.c_str());
    u8g2.drawStr(0,43,localIP.c_str());
    u8g2.drawStr(0,60,"xMing for CenXue");
  }while(u8g2.nextPage());
}
void ShowWeather(String Temperature) {
    do{
      u8g2.drawStr(64, 20, "Temp:");
      u8g2.drawStr(64, 30, (Temperature+"C").c_str());
    }while(u8g2.nextPage());
}
void ShowTime(String time) {
    do{
        u8g2.drawStr(60, 20, "TIME");
        u8g2.setCursor(64,50);
        u8g2.print(time);
    } while(u8g2.nextPage());
}
void Moe() {
    DrawEmoji(moe);
}

void Dead() {
    DrawEmoji(dead);
}

void Pig() {
  DrawEmoji(pig);
}

void Emm() {
  DrawEmoji(emm);
}